import Vue from 'vue';
import Vuex from 'Vuex';
Vue.use(Vuex);
export default new Vuex.Store({
    state:{
       user:{
        username:localStorage.getItem('user')==null||localStorage.getItem('user')==''?'':(JSON.parse(localStorage.getItem("user"))).name,
        name:'lisi'
    } 
    },mutations:{
        login(state,u){
            localStorage.setItem('user',JSON.stringify(u));
        }
    }

})